package com.mccken.springframework.context.support;

import com.mccken.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.mccken.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-12-02 10:40
 **/
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{
	
	@Override
	protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
		XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
		String[] configLocations = getConfigLocations();
		if (null != configLocations) {
			beanDefinitionReader.loadBeanDefinitions(configLocations);
		}
	}

	protected abstract String[] getConfigLocations();
}
